package com.jiaotong.smart.smartjiaotong.controller;

import com.jiaotong.smart.smartjiaotong.service.OperateLogService;
import com.jiaotong.smart.smartjiaotong.structure.Result;
import com.jiaotong.smart.smartjiaotong.structure.OperateLogStruct.getOperateLogRes;
import com.jiaotong.smart.smartjiaotong.structure.OperateLogStruct.getOperateLogsReq;
import com.jiaotong.smart.smartjiaotong.structure.OperateLogStruct.getWarningLogsReq;
import com.jiaotong.smart.smartjiaotong.structure.OperateLogStruct.getWarningLogsRes;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/operateLog")
public class OperateLogController {

    @Autowired
    private OperateLogService operateLogService;

    @PostMapping("/getOperateLogs")
    public Result<getOperateLogRes> getOperateLogs(getOperateLogsReq req) {
        return Result.success(operateLogService.getOperateLogs(req));
    }

    @PostMapping("/getWarningLogs")
    public Result<getWarningLogsRes> getWarningLogs(getWarningLogsReq req) {
        return Result.success(operateLogService.getWarningLogs(req));
    }
}
